package com.example;

import org.redisson.Redisson;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }
    @Bean
    public Redisson redisson(){
        // 此为单机模式
        Config config=new Config();
        config.useSingleServer().setAddress("redis://localhost:6379").setDatabase(0);
//        config.setLockWatchdogTimeout(10000); //设置分布式锁 watch dog超时时间
        return (Redisson)Redisson.create(config);
    }

    /**
     * redisTemplate 序列化使用的 jdk Serializeable, 存储二进制字节码，所以自定义序列化类
     */











}
